<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRenewLeasesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('renew_leases', function (Blueprint $table) {
            $table->id();
            $table->string('order_sn')->default('')->comment('订单编号');
            $table->string('user_name')->default('')->comment('续租人');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->tinyInteger('type')->default(1)->comment('1线上2线下');
            $table->decimal('money',10,2)->default(0.00)->comment('续租金额');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `renew_leases` comment '续租记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('renew_leases');
    }
}
